home *** CD-ROM | disk | FTP | other *** search
/ Magazyn Click 1 (Special Issue) / fantasy.iso / Demo The Druid King / DemoMap.pak / SEQUENCES_S01_MAIN.VS < prev    next >
Text File  |  2001-04-11  |  8KB  |  284 lines

  1. // void
  2. NamedObj Keltill, Pavonius, Daranix, Ogox, LudgunumMessenger;
  3. ObjSet GaulArmy, TeutonArmy, RomanArmy, Council;
  4. ObjList TeutonsDie;
  5. TPoint pt, pt2;
  6. TRect rc;
  7. Conversation conv;
  8. Unit Gaul1, Gaul2;
  9. Unit invalid;
  10. bool bPavoniusLeft, bHeroFound, bFirst;
  11. int i, time;
  12.  
  13. // players map
  14. // 1 - gauls
  15. // 2 - teutons
  16. // 3 - romans
  17. // 4 - non-controllable gauls (messengers etc.) - same color as gauls
  18. // 5 - enemy gauls -- same colour as gauls
  19.  
  20. //init part
  21.     cls();
  22.     PlayersAlly(1,3);
  23.     PlayersAlly(3,4);
  24.     PlayersAlly(1,4);
  25.     PlayersShareView(1,4);
  26.  
  27.     RunSequence("s01_find_ogox");
  28.     RunSequence("s01_repair_wkorthe");
  29.  
  30.     pt.Set(6400,14500);
  31.     View(pt,false);
  32.  
  33. // spawn Keltill
  34.     Keltill = CreateNamedObj("Keltill", PlaceEx("Keltill", 6400, 14200, 1));
  35.     Keltill.obj.AsUnit.SetExperience(50);
  36.  
  37. // spawn gaul army
  38.     PlaceBlockEx("GArcher", 1, 6300, 14300, 10, 1, 50, 50, "GaulArmy");
  39.     PlaceBlockEx("GAxeman", 1, 6300, 14350, 10, 2, 50, 50, "GaulArmy");
  40.     GaulArmy = GetObjSet("GaulArmy");
  41.     GaulArmy.AddCommand(true,"attach", Keltill.obj);
  42.     GaulArmy.KillCommand();
  43.  
  44.  
  45. // spawn first Teuton army and attack
  46.     PlaceBlockEx("TeutonWolf", 2, 6300, 15200, 10, 3, 50, 100, "TeutonArmy");
  47.     TeutonArmy = GetObjSet("TeutonArmy");
  48.     pt.Set(6300, 14300);
  49.     TeutonArmy.AddCommand(true, "advance", pt);
  50.     TeutonArmy.KillCommand();
  51.  
  52. // battle
  53.     while (TeutonArmy.Count() > 25) {
  54.         Sleep(500);
  55.         //Keltill.obj.health=Keltill.obj.maxhealth;
  56.     }
  57.  
  58. // retreat
  59.     pt.Set(4700, 14000);
  60.     TeutonArmy.AddCommand(true,"move", pt);
  61.     pt.Set(3300, 12600);
  62.     TeutonArmy.AddCommand(false,"move", pt);
  63.     TeutonArmy.KillCommand();
  64.  
  65. //select X of them to remain
  66.     TeutonsDie = TeutonArmy.GetObjList();
  67.     for (i=0; i<15; i+=1) {
  68.         //TeutonsDie[i].AddCommand(false, "attack", Keltill.obj);
  69.         TeutonsDie[i].KillCommand();
  70.         TeutonsDie[i].KillCommand(); //kill the two move's
  71.     }
  72.  
  73.     Sleep(4000);
  74.     EnvWriteInt("/NewNote", 9);
  75.     Run("currentmap/mission_notes.vs");
  76.  
  77.  
  78.        //rc.Set(3000,12000,4400,13000);
  79.        rc.Set(2642, 11370, 4250, 13384);
  80.        time = GetTime();
  81.        bFirst = true;
  82.     while(1) {
  83.         if (ptInRect(Keltill.obj.pos, rc)) break;
  84.         if (bFirst)
  85.             if (GetTime() - time > 60000) { //change notes
  86.                 bFirst = false;
  87.                 EnvWriteInt("/Note9", 0);
  88.                 EnvWriteInt("/NewNote", 14);
  89.                 Run("currentmap/mission_notes.vs");
  90.             }
  91.         Sleep(500);
  92.     }
  93. // spawn Pavonius and roman army
  94.     PlaceBlockEx("Pretorian", 3, 3500, 12000, 5, 5, 50, 50, "PavoniusArmy");
  95.     RomanArmy = GetObjSet("PavoniusArmy");
  96.     Pavonius = CreateNamedObj("Pavonius", PlaceEx("Pavonius", 3650, 12050, 3));
  97.     Pavonius.obj.AsUnit.SetExperience(20);
  98.     RomanArmy.AddCommand(true,"attach", Pavonius.obj);
  99.     RomanArmy.KillCommand();
  100. // join battle
  101.     pt.Set(4000,12400);
  102.     Pavonius.obj.AddCommand(true, "advance", pt);
  103.     Pavonius.obj.KillCommand();
  104.  
  105.  
  106. // spawn second teuton army
  107.     EnvWriteInt("/Note9", 0);
  108.     EnvWriteInt("/Note14", 0);
  109.  
  110.     PlaceBlockEx("TeutonWolf",2 , 3200, 12600, 6, 4, 100, 100, "TeutonArmy");
  111.  
  112.     cls();
  113.     pt.Set(3800,12200);
  114.     TeutonArmy.AddCommand(true,"advance", pt);
  115.     pt.Set(3900,12300);
  116.     TeutonArmy.AddCommand(false,"advance", pt);
  117.     TeutonArmy.KillCommand();
  118.  
  119. //a warrior comes to announce Milys' death
  120.     RunSequence("s01_milys_messenger");
  121.  
  122. // battle
  123.     while (TeutonArmy.Count()>0) {
  124.         Sleep(300);
  125.         //Keltill.obj.health=Keltill.obj.maxhealth;
  126.         //Pavonius.obj.health=Pavonius.obj.maxhealth;
  127.     }
  128.  
  129.     if (!Pavonius.IsDead()) Pavonius.obj.KillCommand();
  130.     Keltill.obj.KillCommand();
  131.     Sleep(3000); //give time for the killcommands
  132.  
  133.  
  134.     if (!Pavonius.IsDead()) {
  135.         while (1) {
  136.             if (Keltill.obj.DistTo(Pavonius.obj) < 600) break;
  137.             Sleep(500);
  138.         }
  139.         conv.Init("DM C1", 2, 0);
  140.         conv.Run();
  141.  
  142. //romans retreat according to the conversation
  143.     if (EnvReadString("/DM C1/Return Value") == "leave") {
  144.         pt.Set(2100,10400);
  145.         Pavonius.obj.AddCommand(true,"move", pt);
  146.         pt.Set(2500,9650);
  147.         Pavonius.obj.AddCommand(false,"move", pt);
  148.         pt.Set(3500,9000);
  149.         Pavonius.obj.AddCommand(false,"move", pt);
  150.         Pavonius.obj.KillCommand();
  151.         EnvWriteInt("/s01/PavoniusDest.x", pt.x);
  152.         EnvWriteInt("/s01/PavoniusDest.y", pt.y);
  153.         RunSequence("s01_pavonius_leave");
  154.         bPavoniusLeft = true;
  155.     } else {
  156.         Pavonius.obj.AddCommand(true,"move", point(4760, 12848));
  157.         Pavonius.obj.AddCommand(false,"move", point(4917, 12865));
  158.         Pavonius.obj.AddCommand(false,"move", point(5031, 12804));
  159.         Pavonius.obj.AddCommand(false,"move", point(5101, 12677));
  160.         Pavonius.obj.AddCommand(false,"move", point(5682, 11450));
  161.         Pavonius.obj.AddCommand(false,"move", point(6006, 10653));
  162.         Pavonius.obj.KillCommand();
  163.         PlayersShareView(1,3);
  164.         PlayersShareSupport(1,3);
  165.         bPavoniusLeft = false;
  166.     }
  167.     } else { // Pavonius is dead
  168.         bPavoniusLeft = true;
  169.     }
  170.  
  171. //wait to repair Wkorthe
  172.     while (1) {
  173.         if (EnvReadInt("/s01/WkortheRepaired") == 1) break;
  174.         Sleep(5000);
  175.     }
  176.  
  177. //give the player some time to wander around, to have chance of finding the extra hero etc.
  178.     for (i=0; i<48; i+=1) {
  179.         Sleep(2500);
  180.         if (EnvReadInt("/s01/OgoxFound") == 1) {
  181.             Sleep(20000);
  182.             break;
  183.         }
  184.     }
  185.  
  186. // Change view to Daranix
  187.     SetPlayer(8); //fog fadeout
  188.     cls();
  189.     //pr("Meanwhile in Gergovia...");
  190.     Sleep(2000);
  191.     pt.Set(1200, 13200);
  192.     View(pt, false);
  193.     SetPlayer(1);
  194.  
  195. //spawn Daranix
  196.     Daranix = CreateNamedObj("Daranix", PlaceEx("Daranix", 1600, 12500, 1));
  197.  
  198. //ludgunum messanger comes to Daranix
  199.     BlockUserInput();
  200.     HideZoomMap();
  201.     LudgunumMessenger = CreateNamedObj("Messenger", PlaceEx("GaulMessenger2", 1300, 13200, 4));
  202.     pt.Set(1600,12600);
  203.     //LudgunumMessenger.obj.AddCommand(true,"move",pt);
  204.     LudgunumMessenger.obj.AddCommand(true,"approach",Daranix.obj);
  205.     LudgunumMessenger.obj.KillCommand();
  206. /*
  207.     while (1) {
  208.         if (Dist(LudgunumMessenger.obj.pos, Daranix.obj.pos) < 150) break;
  209.         Sleep(500);
  210.     } */
  211.     while (LudgunumMessenger.obj.script == "approach") Sleep(500);
  212.  
  213.     conv.Init("DM C4", 2, 0);
  214.     //conv.SetActor("Daranix", Daranix.obj.AsUnit,"assets/classes/images/demoactors/daranix.bmp");
  215.     //conv.SetActor("Messenger", LudgunumMessenger, "assets/classes/images/demoactors/villager.bmp");
  216.     conv.Run();
  217.     LudgunumMessenger.obj.SetPlayer(1);
  218.     UnblockUserInput();
  219.  
  220. //gather the war council
  221.  
  222.     Ogox = GetNamedObj("Ogox");
  223.     if (EnvReadInt("/s01/OgoxFound") == 1) {
  224.         bHeroFound = true;
  225.         cls();
  226.     } else {
  227.         bHeroFound = false;
  228.         //EnvWriteInt("/s01/OgoxThreadDie",1);
  229.     }
  230.  
  231.     Council = GetObjSet("Council");
  232.     if (!bPavoniusLeft) {
  233.         Pavonius.obj.AddToGroup(Council);
  234.         //PlayersShareControl(1,3); //allow user to command Pavonius
  235.         Pavonius.obj.AsHero.DetachArmy();
  236.         Pavonius.obj.AddCommand(true, "move", point(4749, 12865));
  237.         Pavonius.obj.AddCommand(false, "move", point(3350,11877));
  238.         Pavonius.obj.AddCommand(false, "move", point(1426,12582));
  239.         Pavonius.obj.KillCommand();
  240.     }
  241.     if (bHeroFound) Ogox.obj.AddToGroup(Council);
  242.     Keltill.obj.AddToGroup(Council);
  243.     Daranix.obj.AddToGroup(Council);
  244.     //LudgunumMessenger = GetNamedObj("Messenger");
  245.     LudgunumMessenger.obj.AddToGroup(Council);
  246.  
  247.        EnvWriteString("/NewNote", 3);
  248.     Run("currentmap/mission_notes.vs");
  249.  
  250.     //rc.Set(1362, 12345, 1637, 12673);
  251.     rc.Set(1290, 12242, 1675, 12672);
  252.     while (1) {
  253.         if (Council.Count() == Council.InRect(rc)) break;
  254.         Sleep(500);
  255.     }
  256.  
  257.     Sleep(1500);
  258.  
  259.     conv.Init("DM C5", 2, 0);
  260.     //conv.SetActor("Keltill", Keltill.obj.AsUnit,"");
  261.     //conv.SetActor("Daranix", Daranix.obj.AsUnit,"");
  262.     //conv.SetActor("Messenger", LudgunumMessenger ,"assets/classes/images/demoactors/messenger.bmp");
  263.     if (bPavoniusLeft)
  264.         conv.SetActor("Pavonius",invalid,"");
  265.     if (bHeroFound) {
  266.         //conv.SetActor("Hero",Ogox.obj.AsUnit,"assets/classes/images/demoactors/villager.bmp","Ogox");
  267.         conv.SetActor("Hero",Ogox.obj.AsUnit,"","Ogox");
  268.     } else {
  269.         conv.SetActor("Hero",invalid,"");
  270.     }
  271.     conv.Run();
  272.  
  273.     EnvWriteInt("/Note3", 0);
  274.  
  275.     if (!bPavoniusLeft) {
  276.         Pavonius.obj.AddCommand(true, "move", point(4760, 12848));
  277.         Pavonius.obj.AddCommand(false, "move", point(6006, 10653));
  278.         Pavonius.obj.KillCommand();
  279.     }
  280.  
  281.  
  282. //end
  283.  
  284.